package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 散客团与报名散客关系
 * 
 * @author zhoulin
 *
 */
@Entity
@Table(name = "travel_nonmemberregister")
@Indexed
public class NonMemberRegister extends BaseModel {

	private static final long serialVersionUID = -958781468251781534L;

	@Id
	@In
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkNonMemberRegister;

	/** 散客团 */
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
	@JoinColumn(name = "pkNonMemberGroup")
	@IndexedEmbedded(depth = 1)
	private NonMemberGroup nonMemberGroup;

	/** 登记信息 */
	@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
	@JoinColumn(name = "pkSignUpRegister")
	@IndexedEmbedded(depth = 1)
	private SignUpRegister signUpRegister;

	@Version
	private Integer version;

	public Long getPkNonMemberRegister() {
		return pkNonMemberRegister;
	}

	public void setPkNonMemberRegister(Long pkNonMemberRegister) {
		this.pkNonMemberRegister = pkNonMemberRegister;
	}

	public NonMemberGroup getNonMemberGroup() {
		return nonMemberGroup;
	}

	public void setNonMemberGroup(NonMemberGroup nonMemberGroup) {
		this.nonMemberGroup = nonMemberGroup;
	}

	public SignUpRegister getSignUpRegister() {
		return signUpRegister;
	}

	public void setSignUpRegister(SignUpRegister signUpRegister) {
		this.signUpRegister = signUpRegister;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
